<%--
  Created by IntelliJ IDEA.
  User: zhangshengjia
  Date: 2023/4/3
  Time: 14:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>图书页面</title>
</head>
<script>
    function del(){
        return confirm("是否要删除这条记录?")
    }
</script>
<body>
<h1>图书详情页面</h1>
<h2>欢迎：${sessionScope.user.username}</h2>
<a href="/book/addBook.jsp">添加图书</a>
<hr>
<table border="1">
    <tr>
        <th>图书ID</th>
        <th>书名</th>
        <th>出版商</th>
        <th>作者</th>
        <th>出版时间</th>
        <th>价格</th>
        <th>图书类型</th>
        <th colspan="3">操作</th>
    </tr>
    <c:forEach var="book" items="${sessionScope.books}">
        <tr>
            <td>${book.id}</td>
            <td>${book.title}</td>
            <td>${book.publisher}</td>
            <td>${book.author}</td>
            <td>${book.publicationTime}</td>
            <td>${book.price}</td>
            <td>${book.cover}</td>
            <td><a href="/book/detailById/${book.id}">图书详情</a></td>
            <td><a href="/book/deleteById/${book.id}">删除</a></td>
            <td><a href="/book/alterById/${book.id}">修改</a></td>
        </tr>
    </c:forEach>
</table>
<hr>
<a href="/user/signOut">返回登录页面</a>
</form>
</body>
</html>
